package vista;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.JSpinner;
import javax.swing.LayoutStyle;
import javax.swing.SpinnerListModel;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeListener;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VistaNivel extends javax.swing.JFrame {
	private JPanel jPanelNivel;
	private JRadioButton jRadioBtnBasico;
	private JButton jbtnGuardar;
	private JButton jBtnSalir;
	private JSpinner jSpinnerMinas;
	private JSpinner jSpinnerColumnas;
	private JSpinner jSpinnerFilas;
	private JLabel jlblMinas;
	private JLabel jlblColumnas;
	private JLabel jlblFilas;
	private JLabel jlblTamano;
	private JRadioButton jRadioBtnPersonalizado;
	private JRadioButton jRadioBtnAvanzado;
	private JRadioButton jRadioBtnIntermedio;
	private JLabel jlblNivel;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				VistaNivel inst = new VistaNivel();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public VistaNivel() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			{
				this.setTitle("Configuración de Niveles");
				jPanelNivel = new JPanel();
				GroupLayout jPanelNivelLayout = new GroupLayout((JComponent)jPanelNivel);
				jPanelNivel.setLayout(jPanelNivelLayout);
				getContentPane().add(jPanelNivel, BorderLayout.CENTER);
				jPanelNivel.setPreferredSize(new java.awt.Dimension(403, 314));
				{
					jlblNivel = new JLabel();
					jlblNivel.setLayout(null);
					jlblNivel.setText("Niveles");
				}
				{
					jlblTamano = new JLabel();
					jlblTamano.setText("Tamaño Personalizado");
				}
				{
					jlblFilas = new JLabel();
					jlblFilas.setText("Número de Filas");
				}
				{
					jlblColumnas = new JLabel();
					jlblColumnas.setText("Número de Columnas");
				}
				{
					jlblMinas = new JLabel();
					jlblMinas.setText("Número de Minas");
				}
				{
					String arreglo[] = new String[250];
					for(int i=4; i<250;i++)
					   arreglo[i] = String.valueOf(i);
					SpinnerListModel jSpinnerFilasModel = 
						new SpinnerListModel(
								arreglo);
					jSpinnerFilas = new JSpinner();
					jSpinnerFilas.setModel(jSpinnerFilasModel);
					jSpinnerFilas.setValue("10");
					jSpinnerFilas.setEnabled(false);
				}
				{
				  String arreglo[] = new String[250];
				  for(int i=4; i<250;i++)
					arreglo[i] = String.valueOf(i);
				  
					SpinnerListModel jSpinner1Model = 
						new SpinnerListModel(
						  arreglo);
					jSpinnerColumnas = new JSpinner();
					jSpinnerColumnas.setModel(jSpinner1Model);
					jSpinnerColumnas.setValue("10");
					jSpinnerColumnas.setEnabled(false);
				}
				{
					String arreglo[] = new String[250];
					for(int i=6; i<250;i++)
					  arreglo[i] = String.valueOf(i);
					SpinnerListModel jSpinner2Model = 
						new SpinnerListModel(
								arreglo);
					jSpinnerMinas = new JSpinner();
					jSpinnerMinas.setModel(jSpinner2Model);
					jSpinnerMinas.setValue("10");
					jSpinnerMinas.setEnabled(false);
				}
				ButtonGroup bgrNiveles = new ButtonGroup();

				{
					jRadioBtnBasico = new JRadioButton();
					jRadioBtnBasico.setText("Basico");
					bgrNiveles.add(jRadioBtnBasico);
					
				}
				{
					jBtnSalir = new JButton();
					jBtnSalir.setText("Salir");
				}
				{
					jbtnGuardar = new JButton();
					jbtnGuardar.setText("Guardar");
				}
				{
					jRadioBtnIntermedio = new JRadioButton();
					jRadioBtnIntermedio.setText("Intermedio");
					bgrNiveles.add(jRadioBtnIntermedio);
				}
				{
					jRadioBtnAvanzado = new JRadioButton();
					jRadioBtnAvanzado.setText("Avanzado");
					bgrNiveles.add(jRadioBtnAvanzado);
				}
				{
					jRadioBtnPersonalizado = new JRadioButton();
					jRadioBtnPersonalizado.setText("Personalizado");
					bgrNiveles.add(jRadioBtnPersonalizado);
				}
					jPanelNivelLayout.setHorizontalGroup(jPanelNivelLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(jPanelNivelLayout.createParallelGroup()
					    .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					        .addComponent(jRadioBtnAvanzado, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)
					        .addGap(25))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					        .addComponent(jRadioBtnIntermedio, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)
					        .addGap(25))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					        .addComponent(jRadioBtnBasico, GroupLayout.PREFERRED_SIZE, 106, GroupLayout.PREFERRED_SIZE)
					        .addGap(25))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					        .addComponent(jlblNivel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					        .addGap(87))
					    .addComponent(jRadioBtnPersonalizado, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE))
					.addGroup(jPanelNivelLayout.createParallelGroup()
					    .addGroup(jPanelNivelLayout.createSequentialGroup()
					        .addGroup(jPanelNivelLayout.createParallelGroup()
					            .addComponent(jlblMinas, GroupLayout.Alignment.LEADING, 0, 151, Short.MAX_VALUE)
					            .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					                .addComponent(jlblColumnas, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 17, Short.MAX_VALUE))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					                .addComponent(jlblFilas, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 27, Short.MAX_VALUE))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					                .addGap(50)
					                .addComponent(jbtnGuardar, GroupLayout.PREFERRED_SIZE, 67, GroupLayout.PREFERRED_SIZE)
					                .addGap(0, 34, Short.MAX_VALUE)))
					        .addGroup(jPanelNivelLayout.createParallelGroup()
					            .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					                .addComponent(jSpinnerMinas, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
					                .addGap(18))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					                .addComponent(jSpinnerColumnas, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
					                .addGap(18))
					            .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					                .addComponent(jSpinnerFilas, GroupLayout.PREFERRED_SIZE, 54, GroupLayout.PREFERRED_SIZE)
					                .addGap(18))
					            .addComponent(jBtnSalir, GroupLayout.Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 72, GroupLayout.PREFERRED_SIZE)))
					    .addGroup(GroupLayout.Alignment.LEADING, jPanelNivelLayout.createSequentialGroup()
					        .addComponent(jlblTamano, GroupLayout.PREFERRED_SIZE, 180, GroupLayout.PREFERRED_SIZE)
					        .addGap(0, 43, Short.MAX_VALUE)))
					.addContainerGap(30, 30));
					jPanelNivelLayout.setVerticalGroup(jPanelNivelLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(jPanelNivelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(jlblTamano, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jlblNivel, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
					.addGroup(jPanelNivelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(jSpinnerFilas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jlblFilas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jRadioBtnBasico, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
					.addGroup(jPanelNivelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(jSpinnerColumnas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jlblColumnas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jRadioBtnIntermedio, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
					.addGroup(jPanelNivelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(jSpinnerMinas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jlblMinas, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jRadioBtnAvanzado, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addGap(13)
					.addComponent(jRadioBtnPersonalizado, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					.addGroup(jPanelNivelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
					    .addComponent(jBtnSalir, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
					    .addComponent(jbtnGuardar, GroupLayout.Alignment.BASELINE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(23, 23));
			}
			pack();
			this.setSize(406, 230);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}
	
	public void addListener(ActionListener actionListener) {
		 this.jRadioBtnBasico.addActionListener(actionListener);
		 this.jRadioBtnIntermedio.addActionListener(actionListener);
		 this.jRadioBtnAvanzado.addActionListener(actionListener);
		 this.jRadioBtnPersonalizado.addActionListener(actionListener);
		 this.jBtnSalir.addActionListener(actionListener);
		 this.jbtnGuardar.addActionListener(actionListener);
	 }

	public JRadioButton getjRadioBtnBasico() {
		return jRadioBtnBasico;
	}

	public void setjRadioBtnBasico(JRadioButton jRadioBtnBasico) {
		this.jRadioBtnBasico = jRadioBtnBasico;
	}

	public JRadioButton getjRadioBtnPersonalizado() {
		return jRadioBtnPersonalizado;
	}

	public void setjRadioBtnPersonalizado(JRadioButton jRadioBtnPersonalizado) {
		this.jRadioBtnPersonalizado = jRadioBtnPersonalizado;
	}

	public JRadioButton getjRadioBtnAvanzado() {
		return jRadioBtnAvanzado;
	}

	public void setjRadioBtnAvanzado(JRadioButton jRadioBtnAvanzado) {
		this.jRadioBtnAvanzado = jRadioBtnAvanzado;
	}

	public JRadioButton getjRadioBtnIntermedio() {
		return jRadioBtnIntermedio;
	}

	public void setjRadioBtnIntermedio(JRadioButton jRadioBtnIntermedio) {
		this.jRadioBtnIntermedio = jRadioBtnIntermedio;
	}

	public JSpinner getjSpinnerMinas() {
		return jSpinnerMinas;
	}

	public void setjSpinnerMinas(JSpinner jSpinnerMinas) {
		this.jSpinnerMinas = jSpinnerMinas;
	}

	public JSpinner getjSpinnerColumnas() {
		return jSpinnerColumnas;
	}

	public void setjSpinnerColumnas(JSpinner jSpinnerColumnas) {
		this.jSpinnerColumnas = jSpinnerColumnas;
	}

	public JSpinner getjSpinnerFilas() {
		return jSpinnerFilas;
	}

	public void setjSpinnerFilas(JSpinner jSpinnerFilas) {
		this.jSpinnerFilas = jSpinnerFilas;
	}

	public void mostrarMensaje(String mensaje) {
		 JOptionPane.showMessageDialog(this, mensaje);
	 }

	public JButton getjBtnSalir() {
		return jBtnSalir;
	}

	public JButton getJbtnGuardar() {
		return jbtnGuardar;
	}
}
